-
-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove out-dated precompile.jl and simplify compile_workload #3871
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3871 +/- ##
==========================================
+ Coverage 98.80% 99.00% +0.19%
==========================================
Files 44 43 -1
Lines 6038 6026 -12
==========================================
Hits 5966 5966
+ Misses 72 60 -12 ☔ View full report in Codecov by Sentry. |
I didn't think this would regress, but it did: (hgh_precompile) pkg> st
Status `/private/tmp/hgh_precompile/Project.toml`
[87dc4568] HiGHS v1.11.0
[4076af6c] JuMP v1.23.3
julia> @time using JuMP, HiGHS
1.836396 seconds (1.14 M allocations: 80.307 MiB, 2.01% gc time, 0.91% compilation time)
julia> @time begin
model = Model(HiGHS.Optimizer)
set_silent(model)
@variable(model, x >= 0)
@variable(model, 0 <= y <= 3)
@objective(model, Min, 12x + 20y)
@constraint(model, c1, 6x + 8y >= 100)
@constraint(model, c2, 7x + 12y >= 120)
optimize!(model)
end
0.122040 seconds (77.83 k allocations: 5.237 MiB, 95.64% compilation time) to (hgh_precompile) pkg> st
Status `/private/tmp/hgh_precompile/Project.toml`
[87dc4568] HiGHS v1.11.0
[4076af6c] JuMP v1.23.3 `https://github.com/jump-dev/JuMP.jl.git#od/precompile`
julia> @time using JuMP, HiGHS
1.868888 seconds (1.14 M allocations: 79.608 MiB, 1.94% gc time, 0.88% compilation time)
julia> @time begin
model = Model(HiGHS.Optimizer)
set_silent(model)
@variable(model, x >= 0)
@variable(model, 0 <= y <= 3)
@objective(model, Min, 12x + 20y)
@constraint(model, c1, 6x + 8y >= 100)
@constraint(model, c2, 7x + 12y >= 120)
optimize!(model)
end
0.333175 seconds (201.20 k allocations: 13.715 MiB, 98.47% compilation time) |
With jump-dev/HiGHS.jl#249 this is back to julia> @time using JuMP, HiGHS
1.942927 seconds (1.17 M allocations: 81.800 MiB, 1.32% gc time, 0.92% compilation time)
julia> @time begin
model = Model(HiGHS.Optimizer)
set_silent(model)
@variable(model, x >= 0)
@variable(model, 0 <= y <= 3)
@objective(model, Min, 12x + 20y)
@constraint(model, c1, 6x + 8y >= 100)
@constraint(model, c2, 7x + 12y >= 120)
optimize!(model)
end
0.093417 seconds (45.31 k allocations: 2.997 MiB, 94.63% compilation time) |
At the start of the year it was (https://jump.dev/milestones/2024/01/30/jump_year_in_review/) julia> @time using JuMP, HiGHS
2.645880 seconds (1.17 M allocations: 82.527 MiB, 4.00% gc time, 0.85% compilation time)
julia> @time begin
model = Model(HiGHS.Optimizer)
set_silent(model)
@variable(model, x >= 0)
@variable(model, 0 <= y <= 3)
@objective(model, Min, 12x + 20y)
@constraint(model, c1, 6x + 8y >= 100)
@constraint(model, c2, 7x + 12y >= 120)
optimize!(model)
end
0.214786 seconds (241.91 k allocations: 16.071 MiB, 97.47% compilation time: 45% of which was recompilation) so this is nice progress. |
For posterity, my other script was: using SnoopCompileCore
using JuMP, HiGHS
tinf = @snoop_inference begin
model = Model(HiGHS.Optimizer)
set_silent(model)
@variable(model, x >= 0)
@variable(model, 0 <= y <= 3)
@objective(model, Min, 12x + 20y)
@constraint(model, c1, 6x + 8y >= 100)
@constraint(model, c2, 7x + 12y >= 120)
optimize!(model)
end;
using SnoopCompile, ProfileView
fg = flamegraph(tinf)
ProfileView.view(fg) |
There's no point compiling methods for
MockOptimzer
, and we now use a concrete CachingOptimizer type. If solvers need better recompilation, they can now do it in their package.As examples, see: